xend: Ignore errors from dying domains in RPC server
When a domain is in the process of shutting down there is a small
window when the domain is known to XenD, but it will be unable to form
an SXPR for it due it being in the middle of device hot-unplug. This
causes the 'xm list' command to totally fail with an error like
# xm list
Error: Device 0 not connected
Usage: xm list [options] [Domain, ...]
The 'xm list' command calls into the 'domains' method of
XMLRPCServer.py in XenD. This method just iterates over the list of
domains, fetching the sxpr for each in turn, but with no exception
handling. So if a single domain fails to generate an sxpr, no data is
returned even for other domains which are still functional. This
patch simply makes XenD ignore and skip over domains which throw an
exception, logging the problematic domain.
NB, this problem only hits 'xm list' if it is configured to use the
legay XMLRPC server instead of XenAPI.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
hvmloader, rombios: Make use of new rom-lock facility in ioemu platform device. Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
vt-d: Fixup when mapping devices on non-PCIe buses
The source-id for transactions on non-PCIe buses seem to originate
from devfn=0 on the secondary bus behind the bridge. Map that ID as
well when assigning the device. The ID to use in these scenarios is
not particularly well documented anywhere.
This adds fixes to the stub domain build into compiling Ian Jackson's
qemu-xen. The most notable change is that mini-os headers now
#include each other through a mini-os/ prefix, so that we can turn all
-I into -isystem and still be sure that we include Mini-OS headers
(and not qemu's console.h or blktaplib's list.h for instance...).
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
The merged qemu tree is now on xenbits at:
http://xenbits.xensource.com/git-http/qemu-xen-unstable.git
(and a corresponding staging tree in /staging).
That's a raw git tree fetchable by `git-clone http://....', so not
really browseable. There will be gitweb, and a real git server, set
up shortly, as well as a one-way Mercurial gateway.
The tools/ioemu subdirectory will remain in the xen-unstable tree for
this release, as an alternative.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
x86 p2m superpage fix: Re-insert missing shadow code from the original
patch that was submitted to xen-devel, to remove mappings when we're
removing a p2m 2mb page.
I originally had just changed the NEWINTF ioctl to send over 48-bits
of information, which works on 64-bit but not on 32-bit (since the arg
is an unsigned long). Additionally, the previous changes would break
an older userland against a new kernel. For that reason, introduce a
new ioctl (NEWINTF_EXT) that fixes both of these problems. This is
the dom0 userland side.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
In pt_bar_mapping function, r->addr should not be changed by invalid
value(-1). This value(-1) causes failure of mapping BAR when I/O Space
or Memory Space enable bit is updated repeatedly by native windows
driver.
* Remove ioemu-dir before replacing it with a symlink so that
switching between trees doesn't go wrong.
* Remove case-based arrangement for making XEN_ROOT absolute
and replace with $(abspath ...) since we depend on GNU make
anyway.
* `make clean' recurses into ioemu-dir
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Previous "xend" assumed initial Xenbus state would be "Connected" when
LUN hot-plug starts. However it was not guaranteed in general, and it
may cause some problems.
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com> Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
Revert c/s 17975 -- enumerate PCI devices in Xen allowing old dom0
kernels to work with iommu-capable platforms. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Previously, all data descriptors used TSE context descriptor. It's not
correct, per spec, data descriptor uses TSE bit to indicate whether
use TSE. Legacy data descripter never use TSE.
numa: Extend MEMOP_ allocation functions to take a node argument.
The address_bits field will be limited to 8 bits and is now embedded
in the mem_flags member, which additionally contains the node number
(limited to 8 bit).
Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
OOS cleanup: Fixup arrays instead of fixup tables.
This patch avoids compromises with evil concepts (reverse maps) in the
shadow code and limits to a maximum value the number of writable
mappings of OOS pages.
The add hypercall will add a new PCI device and register it. The
remove hypercall will remove the pci_dev strucure for the device. The
IOMMU hardware (if present) will be notifed as well.
Add management and locking of PCI device structures
Add functions for managing pci_dev structures. Create a list
containing all current pci_devs. Remove msi_pdev_list. Create a
read-write lock protecting all pci_dev lists. Add spinlocks for
pci_dev access. Do necessary modifications to MSI code.
Restructure VT-d device scope and PCI bridge handling
Create a bitmap for each device scope indicating which buses are
covered by the scope. Upon mapping PCI-PCI bridges we now detect
whether we have a bridge to a non-PCIe bus. If so, all devices mapped
on that bus are squashed to the requester-id of the bridge. Bridges
to PCIe busses are ignored. The requester-id squashing also
determines the iommu device group id for the device.
Move the pci_dev list from hvm to arch_domain since PCI devs are no
longer hvm specific. Also removed locking for pci_dev lists. Will
reintroduce them later.
This makes stubdom use the host's gcc instead of downloading/compiling
binutils+gcc. That requires a bunch of changes and even uncovered a
few bugs, but saves a lot of time.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/vgabios
co vgabios
Patchs backported:
- vgabios: Support VESA power management extensions. (cs 17692)
- x86, hvm: Allow Cirrus VGA BIOS to clear framebuffer with minimal
PIO writes. (cs 16242)
This patch fixes the bug with the IDR boot CD.
Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Teach xc_save to use event-channel-based domain suspend if available.
If the guest provides a suspend event channel through xenstore,
xc_save will use it in preference to the old xenstore-based method.
Xend is still informed when the domain has suspended so that it can
perform device migration in parallel with last-round migration.
Add facility to get notification of domain suspend by event channel.
This event channel will be notified when the domain transitions to the
suspended state, which can be much faster than raising VIRQ_DOM_EXC
and waiting for the notification to be propagated via xenstore.
No attempt is made here to prevent multiple subscribers (last one
wins), or to detect that the subscriber has gone away. Userspace tools
should take care.
ioemu: Support more Capability Structures (including MSI/MSI-X)
and Device Specific Registers for pt device.
I implemented following Capability Structures and Device Specific
Registers.
* Configuration Header Type 0
-> emulation.
"emulation" does not mean no accessing real I/O device.
Access real I/O device, but guest value and real value
might be different.
* MSI Capability Structure
-> emulation.
Behavior is not changed from existed implementation in
pt-msi.c, although code is changed.
* MSI-X Capability Structure
-> emulation.
Behavior is not changed from existed implementation in
pt-msi.c, although code is changed.
* PCI Express Capability Structure
-> emulation.
* PCI Power Management Capability Structure
-> emulation.
* Vital Product Data Capability Structure
-> emulation.
Emulated register is only Next Capability Pointer
Register.
All other registers are passthrough.
* Vendor Specific Capability Structure
-> emulation
Emulated register is only Next Capability Pointer
Register.
All other registers are passthrough.
* Device Specific Register (exclude capability structures)
-> passthrough.
The device drivers in guest domain are allowed to access
Device Specific Register. So various I/O device will work.
I assigned following device to guest domain, and they worked fine.
- PCIe NIC (MSI)
- PCI NIC (MSI)
- UHCI (INTx interrupt)
- IDE Controller (INTx interrupt)
Remove the resetting of the policy from this point in the test case
since the new default policy has the '__UNLABELED__' label, which is
not expected in subsequent checks.
Support building of out-of-tree merged qemu from git
This provides support for building the new merged qemu from
qemu-xen.git, or from a local checkout.
The default is still to use the in-tree version, because the patchman
infrastructure for testing, and propagation from staging to
xen-unstable, needs a small amount of work to cope with git.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
iommu: Fix hvm_dpci_eoi for smp guest in ioapic interrupt mode
My testing shows, for some smp guests, ent->fields.mask will not be
unmasked when hvm_dpci_eoi() is invoked at the first time. In that
case, we should rely on timeout call back to do pirq_guest_eoi() and
should not stop the per-irq timer too early.
From: Wei Wang <wei.wang2@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
It's not a sensible thing to do, and it is easier than auditing all
state save/restore functions for safety (most importantly, racing
against domain_relinquish_resources).
Also place a spin_barrier on domain_lock after asserting d->is_dying,
allowing critical regions under the domain_lock to safely check
is_dying and avoid races with domain_relinquish_resources().
Provide emulation for all FPU instructions except fsave/frstore &
fnstenv/fldenv.
While the main purpose of the patch is to avoid current and future
"gotchas" on FPU intructions used by various OS boot-loaders, it is
complete enough to run DOS realmode FPU applications and benchmarks,
but don't expect to set any speed records.